<template>
  <div>
    <van-nav-bar
        title=""
        left-text="Return"
        left-arrow
        @click-left="tzback()"
    />
<!--    1.创建标签-->
    <div id="dvmap"></div>
  </div>
</template>

<script>
export default {
  name: "StoreMap",
  data(){
    return{
    }
  },
  methods:{
    tzback(){
      var mid=this.$route.query.mid;
      this.$router.push({path:"/bathDetail",query:{mid:mid}});
    },
  },
  mounted() {

    var mid=this.$route.query.mid;
    var longitude=this.$route.query.longitude;
    var latitude=this.$route.query.latitude;
    console.log(mid)
    //页面加载就调用
    var map = new BMapGL.Map("dvmap");
    console.log(longitude,latitude)
    // 创建地图实例
    var point = new BMapGL.Point(longitude,latitude);
    // 创建点坐标
    map.centerAndZoom(point, 15);
    // 初始化地图，设置中心点坐标和地图级别
  }

}
</script>

<style scoped>
#dvmap{
  height: 30rem;
  width: 100%;
}
</style>